//
//  TieSuccessV.m
//  Toyohu
//
//  Created by GuoPeng on 16/4/28.
//  Copyright © 2016年 celia. All rights reserved.
//

#import "TieSuccessV.h"
#import "UIView+Fillet.h"

@interface TieSuccessV ()
{
    
}

@property (weak, nonatomic) IBOutlet UIView *titleLabel;
@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (weak, nonatomic) IBOutlet UIImageView *resultImage;


@end

@implementation TieSuccessV

+ (void)show
{
    [[self alloc]  initWithFrame:[[UIScreen mainScreen] bounds]];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [[[NSBundle mainBundle] loadNibNamed:@"TieSuccessV" owner:self options:nil] objectAtIndex:0];
    if (self) {
        self.frame = frame;
        
        [self initView];
        [[[UIApplication sharedApplication] keyWindow] addSubview:self];
        
        [self dismiss];
        
        
    }
    return self;
}

- (void)dismiss
{
    double delayInSeconds = 3.0;
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
    dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
        [self removeFromSuperview];
    });
}

- (void)initView{

    
    [self.bgView filletWithcornerRadius:8.0f];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
